package thedealmapsample;

import Data.Businesses;
import Data.Deals;
import Data.ProposedDeal;
import TheDealmap.Service;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static void main(String[] args) throws UnsupportedEncodingException, MalformedURLException, IOException, Exception {
        System.out.println("Starting Java Library Test");
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, 5);
        Service service = new Service("0-673995604-634157758518545000");
        Deals deals = service.SearchDeals(0 | 8, 16 | 8, cal.getTime(), 47.67856, -122.130994, null, null, null, null);
        Businesses businesses = service.SearchBusinessListings(0, 47.67856, -122.130994, null, 6.5, 0, 100);

        ProposedDeal deal = new ProposedDeal("DEV", cal.getTime(), "probablyandrew@moo.com", "123 Test", "USA", "Cupertino", "CA", "20630Valley Green Dr");
        deal.setLatitude(29.98285500000003003);
        deal.setLongitude(-41.48437500030030303);
        deal.setCategory("HomeGarden");
        String response = service.SubmitDeal(deal);
        System.out.println(response);
    }
}
